package me.yobol.greentable.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

import me.yobol.greentable.bean.DishesBean;

/**
 * @author Yobol
 *
 */
public interface IDishesDAO {
	
	public int save(Connection ctn,DishesBean dishes) throws SQLException;
	
	public DishesBean delete(Connection ctn,int dishesId) throws SQLException;
	
	public void update(Connection ctn,int dishesId,DishesBean dishes) throws SQLException;
	public void updateName(Connection ctn,int dishesId,String name) throws SQLException;
	public void updateDescription(Connection ctn,int dishesId,String description) throws SQLException;
	public void updateContent(Connection ctn,int dishesId,String content) throws SQLException;
	public void updateScansCtr(Connection ctn,int dishesId,int scansCtr) throws SQLException;
	public void updateFavouriteCtr(Connection ctn,int dishesId,int favouriteCtr) throws SQLException;
	public void updateCommentCtr(Connection ctn,int dishesId,int commentCtr) throws SQLException;
	public void updateMenuId(Connection ctn,int dishesId,int menuId) throws SQLException;

	public DishesBean get(Connection ctn,int dishesId) throws SQLException;
	public List<DishesBean> getAll(Connection ctn) throws SQLException;
	public List<DishesBean> getFirstNDsByScans(Connection ctn, int n) throws SQLException;
	public List<DishesBean> getByName(Connection ctn,String name) throws SQLException;
	public List<DishesBean> getByOwner(Connection ctn,int ownerId) throws SQLException;
	public List<DishesBean> getByTime(Connection ctn,Timestamp time) throws SQLException;
	public List<DishesBean> getByMenuId(Connection ctn,int menuId) throws SQLException;
	public List<DishesBean> getByNameAndOwner(Connection ctn,String name,int owner) throws SQLException;
}
